package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * The persistent class for the job_seeker database table.
 */
@Entity
@Table(name = "job_seeker")
@NamedQueries({
        @NamedQuery(name = "JobSeeker.findAll", query = "SELECT j FROM JobSeeker j"),
        @NamedQuery(name = "JobSeeker.findById", query = "SELECT j FROM JobSeeker j WHERE j.id = :id"),
        @NamedQuery(name = "JobSeeker.findByName", query = "SELECT j FROM JobSeeker j WHERE j.name = :name"),
        @NamedQuery(name = "JobSeeker.findByBirthday", query = "SELECT j FROM JobSeeker j WHERE j.birthday = :birthday"),
        @NamedQuery(name = "JobSeeker.findByPhoneNumber", query = "SELECT j FROM JobSeeker j WHERE j.phoneNumber = :phoneNumber"),
        @NamedQuery(name = "JobSeeker.findByMobileNumber", query = "SELECT j FROM JobSeeker j WHERE j.mobileNumber = :mobileNumber"),
        @NamedQuery(name = "JobSeeker.findByGpa", query = "SELECT j FROM JobSeeker j WHERE j.gpa = :gpa"),
        @NamedQuery(name = "JobSeeker.findByGpaScale", query = "SELECT j FROM JobSeeker j WHERE j.gpaScale = :gpaScale"),
        @NamedQuery(name = "JobSeeker.findBySalary", query = "SELECT j FROM JobSeeker j WHERE j.salary = :salary"),
        @NamedQuery(name = "JobSeeker.findByExperience", query = "SELECT j FROM JobSeeker j WHERE j.experience = :experience")})
public class JobSeeker implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    @Lob()
    @Column(nullable = false)
    private String ability;

    @Lob()
    @Column(nullable = false)
    private String address;

    @Temporal(TemporalType.DATE)
    @Column(nullable = false)
    private Date birthday;

    @Column(nullable = false)
    private int experience;

    @Column(nullable = false)
    private double gpa;

    @Column(name = "gpa_scale", nullable = false)
    private double gpaScale;

    @Column(name = "mobile_number", length = 12)
    private String mobileNumber;

    @Column(nullable = false, length = 255)
    private String name;

    @Column(name = "phone_number", length = 12)
    private String phoneNumber;

    @Column(nullable = false, precision = 10, scale = 2)
    private BigDecimal salary;

    // bi-directional many-to-one association to Country
    @ManyToOne
    @JoinColumn(name = "id_country", nullable = false)
    private Country country;

    // bi-directional many-to-one association to Position
    @ManyToOne
    @JoinColumn(name = "id_position", nullable = false)
    private Position position;

    // bi-directional many-to-one association to Subject
    @ManyToOne
    @JoinColumn(name = "id_subject", nullable = false)
    private Subject subject;

    // bi-directional many-to-one association to University
    @ManyToOne
    @JoinColumn(name = "id_university", nullable = false)
    private University university;

    // bi-directional many-to-one association to Province
    @ManyToOne
    @JoinColumn(name = "id_province", nullable = false)
    private Province province;

    // bi-directional many-to-one association to State
    @ManyToOne
    @JoinColumn(name = "id_state", nullable = false)
    private State state;

    // bi-directional many-to-one association to JobseekerHistory
    @OneToMany(mappedBy = "jobSeeker")
    private List<JobseekerHistory> jobseekerHistories;

    public JobSeeker() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAbility() {
        return this.ability;
    }

    public void setAbility(String ability) {
        this.ability = ability;
    }

    public String getAddress() {
        return this.address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Date getBirthday() {
        return this.birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public int getExperience() {
        return this.experience;
    }

    public void setExperience(int experience) {
        this.experience = experience;
    }

    public double getGpa() {
        return this.gpa;
    }

    public void setGpa(double gpa) {
        this.gpa = gpa;
    }

    public double getGpaScale() {
        return this.gpaScale;
    }

    public void setGpaScale(double gpaScale) {
        this.gpaScale = gpaScale;
    }

    public String getMobileNumber() {
        return this.mobileNumber;
    }

    public void setMobileNumber(String mobileNumber) {
        this.mobileNumber = mobileNumber;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhoneNumber() {
        return this.phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public BigDecimal getSalary() {
        return this.salary;
    }

    public void setSalary(BigDecimal salary) {
        this.salary = salary;
    }

    public Country getCountry() {
        return this.country;
    }

    public void setCountry(Country country) {
        this.country = country;
    }

    public Position getPosition() {
        return this.position;
    }

    public void setPosition(Position position) {
        this.position = position;
    }

    public Subject getSubject() {
        return this.subject;
    }

    public void setSubject(Subject subject) {
        this.subject = subject;
    }

    public University getUniversity() {
        return this.university;
    }

    public void setUniversity(University university) {
        this.university = university;
    }

    public Province getProvince() {
        return this.province;
    }

    public void setProvince(Province province) {
        this.province = province;
    }

    public State getState() {
        return this.state;
    }

    public void setState(State state) {
        this.state = state;
    }

    public List<JobseekerHistory> getJobseekerHistories() {
        return this.jobseekerHistories;
    }

    public void setJobseekerHistories(List<JobseekerHistory> jobseekerHistories) {
        this.jobseekerHistories = jobseekerHistories;
    }

}